home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1996 March
/
EnigmA AMIGA RUN 05 (1996)(G.R. Edizioni)(IT)[!][issue 1996-03][Skylink CD IV].iso
/
earcd
/
util2
/
fiflb381.lha
/
inlinef
/
fifo.h
Wrap
C/C++ Source or Header
|
1995-12-09
|
3KB
|
125 lines
#ifndef _INLINE_FIFO_H
#define _INLINE_FIFO_H
#ifndef _CDEFS_H_
#include <sys/cdefs.h>
#endif
#ifndef __INLINE_STUB_H
#include <inline/stubs.h>
#endif
__BEGIN_DECLS
#ifndef BASE_EXT_DECL
#define BASE_EXT_DECL
#define BASE_EXT_DECL0 extern struct Library *FifoBase;
#endif
#ifndef BASE_PAR_DECL
#define BASE_PAR_DECL
#define BASE_PAR_DECL0 void
#endif
#ifndef BASE_NAME
#define BASE_NAME FifoBase
#endif
BASE_EXT_DECL0
extern __inline long
BufSizeFifo (BASE_PAR_DECL FifoHan fifo)
{
BASE_EXT_DECL
register long res __asm("d0");
register struct Library * a6 __asm("a6") = BASE_NAME;
register FifoHan d0 __asm("d0") = fifo;
__asm __volatile ("jsr a6@(-0x3c:W)"
: "=r" (res)
: "r" (a6), "r" (d0)
: "d0", "d1", "a0", "a1", "cc", "memory");
return res;
}
extern __inline void
CloseFifo (BASE_PAR_DECL FifoHan fifo, long flags)
{
BASE_EXT_DECL
register struct Library * a6 __asm("a6") = BASE_NAME;
register FifoHan d0 __asm("d0") = fifo;
register long d1 __asm("d1") = flags;
__asm __volatile ("jsr a6@(-0x24:W)"
: /* No Output */
: "r" (a6), "r" (d0), "r" (d1)
: "d0", "d1", "a0", "a1", "cc", "memory");
}
extern __inline FifoHan
OpenFifo (BASE_PAR_DECL char * name, long bytes, long flags)
{
BASE_EXT_DECL
register FifoHan res __asm("d0");
register struct Library * a6 __asm("a6") = BASE_NAME;
register char * d0 __asm("d0") = name;
register long d1 __asm("d1") = bytes;
register long a0 __asm("a0") = flags;
__asm __volatile ("jsr a6@(-0x1e:W)"
: "=r" (res)
: "r" (a6), "r" (d0), "r" (d1), "r" (a0)
: "d0", "d1", "a0", "a1", "cc", "memory");
return res;
}
extern __inline long
ReadFifo (BASE_PAR_DECL FifoHan fifo, char ** buf, long bytes)
{
BASE_EXT_DECL
register long res __asm("d0");
register struct Library * a6 __asm("a6") = BASE_NAME;
register FifoHan d0 __asm("d0") = fifo;
register char ** d1 __asm("d1") = buf;
register long a0 __asm("a0") = bytes;
__asm __volatile ("jsr a6@(-0x2a:W)"
: "=r" (res)
: "r" (a6), "r" (d0), "r" (d1), "r" (a0)
: "d0", "d1", "a0", "a1", "cc", "memory");
return res;
}
extern __inline void
RequestFifo (BASE_PAR_DECL FifoHan fifo, struct Message * msg, long req)
{
BASE_EXT_DECL
register struct Library * a6 __asm("a6") = BASE_NAME;
register FifoHan d0 __asm("d0") = fifo;
register struct Message * d1 __asm("d1") = msg;
register long a0 __asm("a0") = req;
__asm __volatile ("jsr a6@(-0x36:W)"
: /* No Output */
: "r" (a6), "r" (d0), "r" (d1), "r" (a0)
: "d0", "d1", "a0", "a1", "cc", "memory");
}
extern __inline long
WriteFifo (BASE_PAR_DECL FifoHan fifo, char * buf, long bytes)
{
BASE_EXT_DECL
register long res __asm("d0");
register struct Library * a6 __asm("a6") = BASE_NAME;
register FifoHan d0 __asm("d0") = fifo;
register char * d1 __asm("d1") = buf;
register long a0 __asm("a0") = bytes;
__asm __volatile ("jsr a6@(-0x30:W)"
: "=r" (res)
: "r" (a6), "r" (d0), "r" (d1), "r" (a0)
: "d0", "d1", "a0", "a1", "cc", "memory");
return res;
}
#undef BASE_EXT_DECL
#undef BASE_EXT_DECL0
#undef BASE_PAR_DECL
#undef BASE_PAR_DECL0
#undef BASE_NAME
__END_DECLS
#endif /* _INLINE_FIFO_H */